package com.xindong.paking.dtos;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

import static com.xindong.paking.entity.constant.Constants.DEFAULT_PAGESIZE;
import static com.xindong.paking.entity.constant.Constants.DEFAULT_PAGE_COUNT;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CouponDTO {

    //主键id
    private Integer id;
    //优惠券名称
    private String couponName;
    //优惠券价值
    private Float couponValue;
    //优惠券类型：1、通用。2、满减券。3、折扣券
    private Integer couponType;
    //优惠券数量，剩余数量
    private Integer couponNum;
    //折扣：如0.5
    private Float couponDiscount;
    //优惠券描述
    private String couponDes;

    //状态：1、生效，2、失效，3、已结束
    private String status;
    //发放时间
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    private Date StartTime;
    //过期时间
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS")
    private Date expirationTime;

    //页码,默认为第一页
    private Integer pageCount = DEFAULT_PAGE_COUNT;

    //每页条数,默认每页10条
    private Integer pageSize = DEFAULT_PAGESIZE;



}
